package com.ding.dailyup.repository;

import java.util.List;
import java.util.Optional;

import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.cache.annotation.Caching;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import com.ding.dailyup.model.StockStrategy;

@Repository
@CacheConfig(cacheNames = "stock:strategy:" + StockStrategy.serialVersionUID)
public interface StockStrategyRepository extends JpaRepository<StockStrategy, Long> {

    @Cacheable(key = "'statusNot:' + #p0")
    Optional<List<StockStrategy>> findByStatusNotOrderById(int status);
}
